/**
* Author: CZ cz.theng@gmail.com
 */

package main

import (
	"fmt"
	"sync"
	"time"
)

var wg sync.WaitGroup

func funcA() {
	for i := 0; i < 5; i++ {
		fmt.Printf("Func A Tick with %d \n", i)
		time.Sleep(200 * time.Microsecond)
	}
	wg.Done()
}

func funcB() {
	for i := 0; i < 5; i++ {
		fmt.Printf("Func B Tick with %d \n", i)
		time.Sleep(200 * time.Microsecond)
	}
	wg.Done()
}

func main() {
	wg.Add(2)
	go funcA()
	go funcB()
	wg.Wait()
}
